$(function() {
    // list页面不显示赞的数量
    $(".posts-item-vote-state").remove();
    $(".posts-item-content").css("padding-left", "0px");

    // section页面，当文章全部显示时，不显示更多按钮。
    $(".section-tree").children().each(function(){
        var list = $(this).find(".article-list").children();
        var total = $(this).find(".more");
        var totalText = total.text();
        var num = parseInt(totalText.slice(4,5));

        if (list.length == num)
        {
            total.hide();
        }
    });

/*
    // 咨询动态
    if ($('#hot-article').length > 0)
    {
        $.ajax({
            url: 'https://cybozudev.kf5.com/apiv2/forums/108673/posts.json',
            dataType: 'json',
            async: true,
            success: function(resp) {
                var articles = resp.posts;
                var i = 0;
                for (article in articles)
                {
                    if (i > 9) { break; }
                    var url = "/hc/kb/article/"+articles[article].id+"/";
                    var $li = $("<li></li>");
                    $li.append($("<a href='"+ url +"' title='"+articles[article].title+"'>"+articles[article].title+"</a>"));
                    $('#hot-article').find('ul').append($li);
                    i++;
                }
            }
        });
    }

    // API更新信息
    if ($('#promoted').length > 0)
    {
        $.ajax({
            url: 'https://cybozudev.kf5.com/apiv2/forums/108672/posts.json',
            dataType: 'json',
            async: true,
            success: function(resp) {
                var articles = resp.posts;
                var i = 0;
                for (article in articles)
                {
                    if (i > 9) { break; }
                    var url = "/hc/kb/article/"+articles[article].id+"/";
                    var $li = $("<li></li>");
                    $li.append($("<a href='"+ url +"' title='"+articles[article].title+"'>"+articles[article].title+"</a>"));
                    $('#promoted').find('ul').append($li);
                    i++;
                }
            }
        });
    }
*/
})// JavaScript Document